Optimal. Leaf size=171 \[ \frac {a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right ) \tan (e+f x)}{6 f}+\frac {a d \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x) \tan (e+f x)}{24 f}+\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {4087, 4082,
3872, 3855, 3852, 8} \begin {gather*} \frac {a d \left (6 c^2+20 c d+9 d^2\right ) \tan (e+f x) \sec (e+f x)}{24 f}+\frac {a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right ) \tan (e+f x)}{6 f}+\frac {a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^3}{4 f}+\frac {a (3 c+4 d) \tan (e+f x) (c+d \sec (e+f x))^2}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3872
Rule 4082
Rule 4087
Rubi steps
\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x)) (c+d \sec (e+f x))^3 \, dx &=\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}+\frac {1}{4} \int \sec (e+f x) (c+d \sec (e+f x))^2 (a (4 c+3 d)+a (3 c+4 d) \sec (e+f x)) \, dx\\ &=\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}+\frac {1}{12} \int \sec (e+f x) (c+d \sec (e+f x)) \left (a \left (12 c^2+15 c d+8 d^2\right )+a \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x) \tan (e+f x)}{24 f}+\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}+\frac {1}{24} \int \sec (e+f x) \left (3 a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right )+4 a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x) \tan (e+f x)}{24 f}+\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}+\frac {1}{8} \left (a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right )\right ) \int \sec (e+f x) \, dx+\frac {1}{6} \left (a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right )\right ) \int \sec ^2(e+f x) \, dx\\ &=\frac {a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a d \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x) \tan (e+f x)}{24 f}+\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}-\frac {\left (a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{6 f}\\ &=\frac {a \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right ) \tanh ^{-1}(\sin (e+f x))}{8 f}+\frac {a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right ) \tan (e+f x)}{6 f}+\frac {a d \left (6 c^2+20 c d+9 d^2\right ) \sec (e+f x) \tan (e+f x)}{24 f}+\frac {a (3 c+4 d) (c+d \sec (e+f x))^2 \tan (e+f x)}{12 f}+\frac {a (c+d \sec (e+f x))^3 \tan (e+f x)}{4 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.72, size = 103, normalized size = 0.60 \begin {gather*} \frac {a \left (3 \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right ) \tanh ^{-1}(\sin (e+f x))+\tan (e+f x) \left (24 (c+d)^3+9 d (2 c+d)^2 \sec (e+f x)+6 d^3 \sec ^3(e+f x)+8 d^2 (3 c+d) \tan ^2(e+f x)\right )\right )}{24 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 223, normalized size = 1.30
method | result | size |
derivativedivides | \(\frac {a \,c^{3} \tan \left (f x +e \right )+3 a \,c^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-3 a c \,d^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+a \,d^{3} \left (-\left (-\frac {\left (\sec ^{3}\left (f x +e \right )\right )}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+a \,c^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+3 a \,c^{2} d \tan \left (f x +e \right )+3 a c \,d^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a \,d^{3} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )}{f}\) | \(223\) |
default | \(\frac {a \,c^{3} \tan \left (f x +e \right )+3 a \,c^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-3 a c \,d^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+a \,d^{3} \left (-\left (-\frac {\left (\sec ^{3}\left (f x +e \right )\right )}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+a \,c^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+3 a \,c^{2} d \tan \left (f x +e \right )+3 a c \,d^{2} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a \,d^{3} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )}{f}\) | \(223\) |
norman | \(\frac {-\frac {a \left (8 c^{3}+12 c^{2} d +12 c \,d^{2}+3 d^{3}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}+\frac {a \left (8 c^{3}+36 c^{2} d +36 c \,d^{2}+13 d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {a \left (72 c^{3}+180 c^{2} d +84 c \,d^{2}+49 d^{3}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{12 f}-\frac {a \left (72 c^{3}+252 c^{2} d +156 c \,d^{2}+31 d^{3}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{12 f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{4}}-\frac {a \left (8 c^{3}+12 c^{2} d +12 c \,d^{2}+3 d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{8 f}+\frac {a \left (8 c^{3}+12 c^{2} d +12 c \,d^{2}+3 d^{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{8 f}\) | \(259\) |
risch | \(\frac {i a \left (16 d^{3}+24 c^{3}-36 c \,d^{2} {\mathrm e}^{5 i \left (f x +e \right )}+216 c^{2} d \,{\mathrm e}^{4 i \left (f x +e \right )}+36 c \,d^{2} {\mathrm e}^{3 i \left (f x +e \right )}+216 c^{2} d \,{\mathrm e}^{2 i \left (f x +e \right )}+144 c \,d^{2} {\mathrm e}^{4 i \left (f x +e \right )}+36 c^{2} d \,{\mathrm e}^{3 i \left (f x +e \right )}+36 c^{2} d \,{\mathrm e}^{i \left (f x +e \right )}+36 c \,d^{2} {\mathrm e}^{i \left (f x +e \right )}-36 c^{2} d \,{\mathrm e}^{5 i \left (f x +e \right )}-36 c^{2} d \,{\mathrm e}^{7 i \left (f x +e \right )}+192 c \,d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-36 c \,d^{2} {\mathrm e}^{7 i \left (f x +e \right )}+72 c^{2} d \,{\mathrm e}^{6 i \left (f x +e \right )}+72 c^{2} d +48 c \,d^{2}+33 d^{3} {\mathrm e}^{3 i \left (f x +e \right )}+72 c^{3} {\mathrm e}^{2 i \left (f x +e \right )}+64 d^{3} {\mathrm e}^{2 i \left (f x +e \right )}-9 d^{3} {\mathrm e}^{7 i \left (f x +e \right )}+24 c^{3} {\mathrm e}^{6 i \left (f x +e \right )}-33 d^{3} {\mathrm e}^{5 i \left (f x +e \right )}+72 c^{3} {\mathrm e}^{4 i \left (f x +e \right )}+48 d^{3} {\mathrm e}^{4 i \left (f x +e \right )}+9 d^{3} {\mathrm e}^{i \left (f x +e \right )}\right )}{12 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}+\frac {a \,c^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{f}+\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c^{2} d}{2 f}+\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c \,d^{2}}{2 f}+\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) d^{3}}{8 f}-\frac {a \,c^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{f}-\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c^{2} d}{2 f}-\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c \,d^{2}}{2 f}-\frac {3 a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) d^{3}}{8 f}\) | \(545\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 288, normalized size = 1.68 \begin {gather*} \frac {48 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a c d^{2} + 16 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a d^{3} - 3 \, a d^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 36 \, a c^{2} d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 36 \, a c d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 48 \, a c^{3} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 48 \, a c^{3} \tan \left (f x + e\right ) + 144 \, a c^{2} d \tan \left (f x + e\right )}{48 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.00, size = 220, normalized size = 1.29 \begin {gather*} \frac {3 \, {\left (8 \, a c^{3} + 12 \, a c^{2} d + 12 \, a c d^{2} + 3 \, a d^{3}\right )} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (8 \, a c^{3} + 12 \, a c^{2} d + 12 \, a c d^{2} + 3 \, a d^{3}\right )} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (6 \, a d^{3} + 8 \, {\left (3 \, a c^{3} + 9 \, a c^{2} d + 6 \, a c d^{2} + 2 \, a d^{3}\right )} \cos \left (f x + e\right )^{3} + 9 \, {\left (4 \, a c^{2} d + 4 \, a c d^{2} + a d^{3}\right )} \cos \left (f x + e\right )^{2} + 8 \, {\left (3 \, a c d^{2} + a d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, f \cos \left (f x + e\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int c^{3} \sec {\left (e + f x \right )}\, dx + \int c^{3} \sec ^{2}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{4}{\left (e + f x \right )}\, dx + \int d^{3} \sec ^{5}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int 3 c d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{2}{\left (e + f x \right )}\, dx + \int 3 c^{2} d \sec ^{3}{\left (e + f x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 380 vs.
\(2 (161) = 322\).
time = 0.54, size = 380, normalized size = 2.22 \begin {gather*} \frac {3 \, {\left (8 \, a c^{3} + 12 \, a c^{2} d + 12 \, a c d^{2} + 3 \, a d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, a c^{3} + 12 \, a c^{2} d + 12 \, a c d^{2} + 3 \, a d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, a c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 36 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 36 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 9 \, a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 72 \, a c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 180 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 84 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 49 \, a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 72 \, a c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 252 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 156 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 31 \, a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 24 \, a c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 108 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 108 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 39 \, a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{4}}}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.34, size = 255, normalized size = 1.49 \begin {gather*} \frac {\left (-2\,a\,c^3-3\,a\,c^2\,d-3\,a\,c\,d^2-\frac {3\,a\,d^3}{4}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+\left (6\,a\,c^3+15\,a\,c^2\,d+7\,a\,c\,d^2+\frac {49\,a\,d^3}{12}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-6\,a\,c^3-21\,a\,c^2\,d-13\,a\,c\,d^2-\frac {31\,a\,d^3}{12}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (2\,a\,c^3+9\,a\,c^2\,d+9\,a\,c\,d^2+\frac {13\,a\,d^3}{4}\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}+\frac {a\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (8\,c^3+12\,c^2\,d+12\,c\,d^2+3\,d^3\right )}{2\,\left (4\,c^3+6\,c^2\,d+6\,c\,d^2+\frac {3\,d^3}{2}\right )}\right )\,\left (8\,c^3+12\,c^2\,d+12\,c\,d^2+3\,d^3\right )}{4\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________